package com.zeta.demo.seata.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.*;
import org.zetaframework.base.entity.Entity;

import java.io.Serial;

/**
 * Seata测试2
 *
 * @author AutoGenerator
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Schema(description = "Seata测试2")
@TableName("demo_seata2")
public class DemoSeata2 extends Entity<Long> {

    @Serial
    private static final long serialVersionUID = 1L;

    /** 名称 */
    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "名称不能为空")
    @Size(max = 32, message = "名称长度不能超过32")
    @TableField(value = "name")
    private String name;

    /** 编码 */
    @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "编码不能为空")
    @Size(max = 32, message = "编码长度不能超过32")
    @TableField(value = "code")
    private String code;

    /** 描述 */
    @Schema(description = "描述", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "describe_")
    private String describe;

    /** 逻辑删除字段 */
    @JsonIgnore
    @Schema(description = "逻辑删除字段", requiredMode = Schema.RequiredMode.REQUIRED)
    @TableLogic
    private Boolean deleted;

}
